package server.tool;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import server.dao.MoneyRecordDao;
import server.model.entity.MoneyRecord;

import javax.transaction.Transactional;
import java.util.Date;

@Component
@Lazy(false)
public class ScheduledBoot {
    @Autowired
    private MoneyRecordDao moneyRecordDao;

   /* @Scheduled(cron="0/59  * * * * ? ")
    @Transactional
    public void zyPay(){
        // 将五分钟以上的丢弃
        DateTime power = DateUtil.offsetMinute(new Date(),-5);
        moneyRecordDao.upStatus(power.getTime());
    }*/
}
